<?php
$cat_by_date=$_POST["cat_by_date"];
if( preg_match("/\d{6}/",$cat_by_date) && $_POST["jump2date"]=="Go" ){
	header("Location: http://www.xys-reader.org/".$cat_by_date);
	//header("Location: http://www.xys-reader.org/p_cat_pd_list.php?cat_by_date=".param("cat_by_date"));
	exit();
}

include("../lib/db.lib");
include("../lib/std.lib");
include("../lib/item.lib");


$cat_id=param("cat_id");
$shop_id=param("shop_id");

$key_au=param("key_au");
$key_title=param("key_title");

if(param("linked")){

//$key_au = iconv("UTF-8","GB2312",$key_au);
$key_au =urldecode($key_au);
$key_title =urldecode($key_title);

}




$title="search $key_au $key_title";
$pd_list=search($key_au,$key_title);
$item_num=count($pd_list);


$start=param("start");
if($start<=0) $start=1;
$step=100;
$pre_start=$start-$step;

if($pre_start>0){
   $p_str= "<a href=\"p_search.php?start=$pre_start&key_au=&key_title=$key_title\">Previous $step </a>&nbsp;";
}
if($item_num >=$start+$step){
    $next_start=$start+$step;
    $n_str= "<a href=\"p_search.php?start=$next_start&key_au=$key_au&key_title=$key_title\">Next $step</a> &nbsp;";
}

$status_str =" ( From $start to ".min($start+$step-1,$item_num).".";
$status_str .=" Total $item_num items) ";

$page_link="http://www.xys-reader.org/xys/p_search.php?linked=1&key_au=".urlencode($key_au)."&key_title=".urlencode($key_title);

$list=$pd_list;

include("d_show_list.php");
?>
